package org.unique.support.upload;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

/**
 * 上传组件
 * @author biezhi
 * @version 0.1.0
 */
public class Uploader {
	
	private HttpServletRequest request;
	public static Map<String, Object> conf = new HashMap<String, Object>();
	
	public Uploader(HttpServletRequest request) {
		this.request = request;
	}
	
	public Uploader(HttpServletRequest request, final Map<String, Object> conf_) {
		this.request = request;
		conf = conf_;
	}
	
	public final String exec(){
		State state = BinaryUploader.save(this.request, conf);
		return state.toJSONString();
	}
}
